<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>应用插件执行日志列表</title>
<link href="../../static/plugin/easyui/themes/bootstrap/easyui.css"
	rel="stylesheet" type="text/css" />
<link href="../../static/plugin/easyui/themes/icon.css" rel="stylesheet"
	type="text/css" />
<script src="../../static/plugin/easyui/jquery.min.js"
	type="text/javascript"></script>
<script src="../../static/plugin/easyui/jquery.easyui.min.js"
	type="text/javascript" charset="utf-8"></script>
<script src="../../static/plugin/easyui/locale/easyui-lang-zh_CN.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js"
	type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js"
	type="text/javascript"></script>
<script src="../../ffres/dict/all.js" type="text/javascript"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">

	function doAdd(){
		JLEUtil.createModalWin('新增', 'PluginExecLogAdd.html');
	}
	
	function doUpdate() {
		var row = $('#dg').datagrid('getSelected');
		if (row){
			JLEUtil.createModalWin('修改', 'PluginExecLogUpdate.html?');
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}
	
	function doDelete(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			$.messager.confirm('删除提示', '你确定要删除这条记录?', function(r) {
				if (r) {
					var jsonData = JSON.parse('{' + '}');
					$.restfulDelete('../../api/plugin/exec/log', jsonData,
							function(data) {
								$.messager.alert('提示', '记录删除成功!', 'info');
								$('#dg').datagrid('reload');
							});
				}
			});
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function doView() {
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('详情', 'PluginExecLogView.html?batchSn='
					+ row.batchSn + '&taskId=' + row.taskId + '&recordTime='
					+ row.recordTime);
		} else {
			$.messager.alert('提示', '请选择一条记录！', 'info');
		}
	}

	function reloadList() {
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};

	$(function() {
		$("#dg").datagrid({
			singleSelect : true,
			collapsible : true,
			url : '../../api/plugin/exec/logs',
			method : 'post',
			queryParams : {
				batchSn : $.getUrlParam('batchSerialNo'),
				taskId : $.getUrlParam('taskId')
			},
			toolbar : "#tb",
			rownumbers : "true",
			pagination : "true",
			pageSize : "20"
		});
	});
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'center',split:false">
		<table id="dg" class="easyui-datagrid" title=""
			style="width: 100%; height: 100%">
			<thead>
				<tr>
					<th data-options="field:'batchSn',resizable:true,hidden:true">批次流水号</th>
					<th data-options="field:'pluginId',resizable:true,hidden:true">应用插件ID</th>
					<th data-options="field:'taskName',resizable:true">任务名称</th>
					<th data-options="field:'pluginName',resizable:true">应用插件名称</th>
					<th data-options="field:'actionName',resizable:true">操作名称</th>
					<th data-options="field:'actionResult',resizable:true"
						formatter="formatter_BAT_EXEC_RESULT">操作结果</th>
					<th data-options="field:'actionDetailInfo',resizable:true">操作详情</th>
					<th data-options="field:'taskId',resizable:true,hidden:true">任务编号</th>
					<th data-options="field:'recordTime',resizable:true">记录时间</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="tb" style="padding: 1px">
		<div style="margin-bottom: 2px">
			<a href="javascript:doView()" class="easyui-linkbutton"
				iconCls="icon-ok" plain="true">查看</a>
		</div>
	</div>
</body>
</html>
